package com.example.demo.repository;

import com.example.demo.bean.FileBean;
import com.example.demo.bean.TimetableBean;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;
import java.util.Map;

/**
 * @author zhangbiao
 * @date 2020/6/25 11:00
 * @desc 描述
 */
public interface FileRepository extends JpaRepository<FileBean, String> {

    public void deleteByObjId(String obj_id);

    @Query(value = "SELECT fl.*,u.course_name FROM t_file fl,t_timetable u WHERE timetable_id = ?1 AND fl.timetable_id = u.obj_id", nativeQuery = true)
    public List<Map<String, Object>> findTaskBean(String timetable_id);
}
